fix(langchain): Set agent name as gen_ai.agent.name#5877
fix(langchain): Set agent name as gen_ai.agent.name#5877alexander-alderman-webb wants to merge 7 commits intomasterfrom
gen_ai.agent.name#5877Conversation
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Langchain
Other
Bug Fixes 🐛Ci
Openai
Other
Documentation 📚
Internal Changes 🔧Ai
Langchain
Openai
Other
Other
🤖 This preview updates automatically when you update the PR. |
gen_ai.agent.name
Codecov Results 📊✅ 134 passed | Total: 134 | Pass Rate: 100% | Execution Time: 20.77s All tests are passing successfully. ❌ Patch coverage is 0.00%. Project has 13948 uncovered lines. Files with missing lines (1)
Generated by Codecov Action |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| set_data_normalized( | ||
| span, | ||
| SPANDATA.GEN_AI_REQUEST_MESSAGES, | ||
| messages_data, |
There was a problem hiding this comment.
Agent name not set on span in stream path
Medium Severity
In _wrap_agent_executor_stream, the old code that set GEN_AI_AGENT_NAME on the span was removed along with the _push_agent call, but unlike _wrap_agent_executor_invoke (which preserved span.set_data(SPANDATA.GEN_AI_AGENT_NAME, run_name)), the stream path never sets the agent name on the agent span. This means streaming agent invocations will be missing the gen_ai.agent.name attribute on the top-level agent span.
Additional Locations (1)
There was a problem hiding this comment.
I will follow up and set the pipeline case in this scenario


Description
Set
lc_agent_nameas thegen_ai.agent.nameattribute.Remove manual accounting of the
run_nameattribute.Issues
Reminders
tox -e linters.feat:,fix:,ref:,meta:)